package com.huaxingbankas.modules.model.backup;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToMany;

/**
 * AbstractSecondMenu entity provides the base persistence definition of the
 * SecondMenu entity. @author MyEclipse Persistence Tools
 */
@MappedSuperclass
public abstract class AbstractSecondMenu implements java.io.Serializable {

	// Fields

	private Integer id;
	private FirstMenu firstMenu;
	private String name;
	private String secondMenuPriority;
	private String secondMenuComment;
	private String defaultValue;
	private Set<ThirdMenu> thirdMenus = new HashSet<ThirdMenu>(0);

	// Constructors

	/** default constructor */
	public AbstractSecondMenu() {
	}

	/** full constructor */
	public AbstractSecondMenu(FirstMenu firstMenu, String name,
			String secondMenuPriority, String secondMenuComment,
			String defaultValue, Set<ThirdMenu> thirdMenus) {
		this.firstMenu = firstMenu;
		this.name = name;
		this.secondMenuPriority = secondMenuPriority;
		this.secondMenuComment = secondMenuComment;
		this.defaultValue = defaultValue;
		this.thirdMenus = thirdMenus;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "first_menu_id")
	public FirstMenu getFirstMenu() {
		return this.firstMenu;
	}

	public void setFirstMenu(FirstMenu firstMenu) {
		this.firstMenu = firstMenu;
	}

	@Column(name = "name", length = 40)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "second_menu_priority", length = 32)
	public String getSecondMenuPriority() {
		return this.secondMenuPriority;
	}

	public void setSecondMenuPriority(String secondMenuPriority) {
		this.secondMenuPriority = secondMenuPriority;
	}

	@Column(name = "second_menu_comment", length = 32)
	public String getSecondMenuComment() {
		return this.secondMenuComment;
	}

	public void setSecondMenuComment(String secondMenuComment) {
		this.secondMenuComment = secondMenuComment;
	}

	@Column(name = "default_value", length = 32)
	public String getDefaultValue() {
		return this.defaultValue;
	}

	public void setDefaultValue(String defaultValue) {
		this.defaultValue = defaultValue;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "secondMenu")
	public Set<ThirdMenu> getThirdMenus() {
		return this.thirdMenus;
	}

	public void setThirdMenus(Set<ThirdMenu> thirdMenus) {
		this.thirdMenus = thirdMenus;
	}

}